package com.eva.service.cms;

import com.eva.dao.cms.CmsTemplateMapper;
import com.eva.dao.cms.model.CmsTemplate;
import com.eva.framework.mp.service.BaseService;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;

@Service
public class CmsTemplateService extends BaseService<CmsTemplate, CmsTemplateMapper> {

    public CmsTemplateService(CmsTemplateMapper mapper, Environment environment) {
        super(mapper, environment);
    }

    /**
     * 根据模板文件路径查询模板
     *
     * @param path 模板文件路径
     * @return CmsTemplate
     */
    public CmsTemplate findByPath (String path) {
        return this.findOne(new CmsTemplate().setPath(path));
    }
}
